package cn.chinaflame.pagodas.entity;

import javax.persistence.*;

import lombok.Data;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Objects;

/**
 * 灯商品精确位置对象
 * @author bm
 * 2018年5月4日 下午3:05:36
 */
@Data
@Entity
@Table(name = "pa_product_point", schema = "pagoda", catalog = "")
public class PaProductPoint {
	@Id
	@Column(name = "id", nullable = false, length = 20)
	private String id;  //
	private String orderitemId;
	@Basic
	@Column(name = "product_id", nullable = true, length = 20)
	private String productId;
	private String positionId;  //位置ID
	private String areaId;  //区域ID
	private String row;  //行号
	private String col;  //列号
	private String locationNo;  //摄像头精确编号
	private int vipFlg;  //是否vip
	private int num;
	private String status;  //占用状态
	private String createtime;
	private String updatetime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PaProductPoint that = (PaProductPoint) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(positionId, that.positionId) &&
                Objects.equals(areaId, that.areaId) &&
                Objects.equals(locationNo, that.locationNo) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createtime, that.createtime) &&
                Objects.equals(updatetime, that.updatetime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, positionId, areaId, locationNo, status, createtime, updatetime);
    }

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return ReflectionToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}
    
}
